package com.g4.shoppingback.controller;


import com.g4.shoppingback.common.Result;
import com.g4.shoppingback.pojo.Permission;
import com.g4.shoppingback.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author admin
 * @since 2022-02-19
 */
@RestController
@CrossOrigin
@RequestMapping("/shoppingback/permission")
public class PermissionController {

    @Autowired
    private IPermissionService iPermissionService;

    /**
     * 查询所有权限
     * @return 返回所有权限
     */
    @GetMapping
    public Result findALL(){
        List<Permission> permissions = iPermissionService.findAll();
        return Result.ok(permissions);
    }
}
